import request from "@/request/request.ts";
import {RoleData} from "@/type/RoleData.ts";

export function getRoleList(){

    return request({
        url: 'api/role/list',
        method: 'GET'
    })
}

export function addRole(role: RoleData){

    return request({
        url: 'api/role/add',
        method: 'POST',
        data: role
    })
}

export function deleteRole(roleId: number){

    return request({
        url: `api/role/delete/${roleId}`,
        method: "DELETE"
    })
}

export function updateRole(role: RoleData) {

    return request({
        url: 'api/role/update',
        method: "POST",
        data: role
    })
}